package com.zhiwei.codesecurity.common.utils;

import java.util.UUID;

public class UUIDUtil {

    public static String getUUID_32() {
        return UUID.randomUUID().toString().replaceAll("-", "");
    }

    public static String getUUID() {
        return UUID.randomUUID().toString();
    }

    public static String getUUID_32(String uuid) {
        if (StringUtils.isBlank(uuid)) {
            return null;
        }

        String rlt = uuid.toString().replace("-", "");
        if (32 == rlt.length()) {
            return rlt;
        }

        return null;
    }
}
